package com.joker.demo.core.domain.enums;


/**
 * @author : feixiang.li
 * @since : 2025-07-25 11:37
 */
public enum JobRegistryStatusEnum {

    /**
     * 0-停止，1-运行中
     */
    STOP(0, "停止"),
    /**
     * 1-运行中
     */
    RUNNING(1, "运行中"),
    ;

    private final Integer code;
    private final String message;

    JobRegistryStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static JobRegistryStatusEnum getByCode(Integer code) {
        for (JobRegistryStatusEnum value : JobRegistryStatusEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static JobRegistryStatusEnum getByMessage(String message) {
        for (JobRegistryStatusEnum value : JobRegistryStatusEnum.values()) {
            if (value.message.equals(message)) {
                return value;
            }
        }
        return null;
    }


}
